load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")

rust_library(
    name = "auth",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {"cargo_toml_config": {
        "dependencies_override": {"dependencies": {
            "sapling-configmodel": {"features": [
                "convert-path",
            ]},
        }},
        "lib": {"name": "auth"},
        "package": {
            "authors": ["Meta Source Control Team <sourcecontrol-dev@meta.com>"],
            "homepage": "https://sapling-scm.com/",
            "license": "MIT",
            "name": "sapling-auth",
            "repository": "https://github.com/facebook/sapling",
        },
    }},
    crate_root = "src/lib.rs",
    test_deps = [
        "fbsource//third-party/rust:once_cell",
        "//eden/scm/lib/config/static:staticconfig",
    ],
    test_srcs = glob(["src/test_certs/*.pem"]),
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:chrono",
        "fbsource//third-party/rust:indexmap",
        "fbsource//third-party/rust:pem",
        "fbsource//third-party/rust:simple_asn1",
        "fbsource//third-party/rust:thiserror",
        "fbsource//third-party/rust:tracing",
        "fbsource//third-party/rust:url",
        "//eden/scm/lib/config/model:configmodel",
        "//eden/scm/lib/util:util",
    ],
)
